package com.itheima.dao.impl;

import com.itheima.dao.MyDataSource;
import com.itheima.dao.SingletonTemplate;
import com.itheima.dao.UserDao;
import com.itheima.daomain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;

import java.sql.SQLException;

public class UserDaoImpl implements UserDao {

    @Autowired
    private MyDataSource dataSource;

    public void save() throws SQLException {
        System.out.println("UserDaoImpl save");
        JdbcTemplate jdbcTemplate= SingletonTemplate.getJdbcTemplate();
        jdbcTemplate.update("insert into mvn(name,age) values(?,?)","names",4)
    }


    public User select(String sql){
        JdbcTemplate jdbcTemplate=SingletonTemplate.getJdbcTemplate();
        jdbcTemplate.update(sql);

    }
}
